/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.unitedats.HR.Entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Awad
 */
@Entity
@Table(name = "hr_employee")
@XmlRootElement
@NamedQueries({
              @NamedQuery(name = "HrEmployee.findAll", query = "SELECT h FROM HrEmployee h"),
              @NamedQuery(name = "HrEmployee.findById", query = "SELECT h FROM HrEmployee h WHERE h.id = :id"),
    })
public class HrEmployee implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;
    
    @Column(name = "name_ar")
    private String nameAr;
    
    @Column(name = "name_en")
    private String nameEn;
    
    @Column(name = "created_in")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdIn;
    
    @Column(name = "last_modified_in")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastModifiedIn;
    
    @Column(name = "status")
    private Short status;
    
    @JoinColumn(name = "last_modified_by", referencedColumnName = "id")
    @ManyToOne
    private HrEmployee lastModifiedBy;
    
    @JoinColumn(name = "created_by", referencedColumnName = "id")
    @ManyToOne
    private HrEmployee createdBy;
    
    public HrEmployee() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNameAr() {
        return nameAr;
    }

    public void setNameAr(String nameAr) {
        this.nameAr = nameAr;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public Date getCreatedIn() {
        return createdIn;
    }

    public void setCreatedIn(Date createdIn) {
        this.createdIn = createdIn;
    }

    public Date getLastModifiedIn() {
        return lastModifiedIn;
    }

    public void setLastModifiedIn(Date lastModifiedIn) {
        this.lastModifiedIn = lastModifiedIn;
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    public HrEmployee getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(HrEmployee lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

  

    public HrEmployee getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(HrEmployee createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HrEmployee)) {
            return false;
        }
        HrEmployee other = (HrEmployee) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.unitedats.HR.Entity.HrEmployee[ id=" + id + " ]";
    }

}
